package net.esj.basic.core.engine.tools.formate.string;

import net.esj.basic.core.engine.tools.formate.ExecuteChain;

public class HtmlTextareaFormatter extends StringFormatter {

	@Override
	public void doExecute(ExecuteChain chain,CharSequence target) {
		target = target.toString().replaceAll("\r\n", "<br>").replaceAll("\n", "<br>").replaceAll(" ", "&nbsp;").replaceAll("\t", "&nbsp;");
		if(chain!=null){
			chain.doExecute(target);
		}
	}

}
